#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <mutex>
using namespace std;

class Signal
{
public:
	static Signal* getInstance()
	{
		if (_inst == nullptr)
		{
			_mtx.lock();
			if (_inst == nullptr)
			{
				_inst = new Signal();
			}
			_mtx.unlock();
		}
		return _inst;
	}
private:
	Signal()
	{
		cout << "Signal()" << endl;
	}
	Signal(const Signal&) = delete;

private:
	static Signal* _inst;
	static mutex _mtx;
};
Signal* Signal::_inst = nullptr;
mutex _mtx;

int main()
{
	Signal* s = Signal::getInstance();
	Signal* s1 = Signal::getInstance();
	Signal* s2 = Signal::getInstance();
	return 0;
}